package com.whw.springboot.bcucb.service.serviceImpl;

import com.whw.springboot.bcucb.entity.Message;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import com.whw.springboot.bcucb.mapper.DownloadMapper;
import com.whw.springboot.bcucb.entity.Download;
import com.whw.springboot.bcucb.service.DownloadService;
@Service
public class DownloadServiceImpl implements DownloadService{

    @Resource
    private DownloadMapper downloadMapper;

    @Override
    public Message<?> deleteByPrimaryKey(Integer downloadId) {
        return downloadMapper.deleteByPrimaryKey(downloadId)>0?Message.success(""):Message.fail("");
    }

    @Override
    public Message<?> insert(Download record) {
        return downloadMapper.insert(record)>0?Message.success(""):Message.fail("");
    }

    @Override
    public Message<?> insertSelective(Download record) {
        return downloadMapper.insertSelective(record)>0?Message.success(""):Message.fail("");
    }

    @Override
    public Message<Download> selectByPrimaryKey(Integer downloadId) {
        return Message.success(null).add(downloadMapper.selectByPrimaryKey(downloadId));
    }

    @Override
    public Message<?> updateByPrimaryKeySelective(Download record) {
        return downloadMapper.updateByPrimaryKeySelective(record)>0?Message.success(""):Message.fail("");
    }

    @Override
    public Message<?> updateByPrimaryKey(Download record) {
        return downloadMapper.updateByPrimaryKey(record)>0?Message.success(""):Message.fail("");
    }

    @Override
    public Message<List<Download>> selectByAll() {
        return Message.success(null).add(downloadMapper.selectByAll());
    }

    @Override
    public Message<List<Download>> selectByCaseId(String caseId) {
        return Message.success(null).add(downloadMapper.selectByCaseId(caseId));
    }

    @Override
    public Message<List<Download>> selectByUserId(String userId) {
        return Message.success(null).add(downloadMapper.selectByUserId(userId));
    }

    @Override
    public Message<List<Download>> selectByUserIdAndDate(String date, String dates, String userId) {
        return Message.success(null).add(downloadMapper.selectByUserIdAndDate(date,dates,userId));
    }

    @Override
    public Message<List<Download>> selectByCaseIdAndDate(String date, String dates, String caseId) {
        return Message.success(null).add(downloadMapper.selectByCaseIdAndDate(date,dates,caseId));
    }

    @Override
    public Message<List<Download>> selectByAllAndDate(String date, String dates) {
        return Message.success(null).add(downloadMapper.selectByAllAndDate(date,dates));
    }

}
